<?php

class Core_Backend_Component_Subject_View_Article_Read extends Core_Backend_Share_View_Form {
	
	protected function initialize(){
		parent::initialize();
		$this->setTemplatePath('read');
	}

	protected function buildToolbar($toolbar) {
		$group = $toolbar->createGroup('back');
		$group->addLink($this->getHistoryUrl('subject/article/index'), $this->__('share.button.back'));
		$group = $toolbar->createGroup('status');
		if($this->getIdentity()->isAllowAction('article_review')){
			$group->addLink($this->getUrl(array('status'=>'published','ids'=>$this->article->getId()), 'review') , $this->__('share.button.publish'));
			$group->addLink($this->getUrl(array('status'=>'forbidden','ids'=>$this->article->getId()), 'review') , $this->__('share.button.forbid'));
		}
		$group = $toolbar->createGroup('delete');
		$group->addLink($this->getUrl(array('ids'=>$this->article->getId()), 'deleteArticle') , $this->__('share.button.delete'));
	}

	public function render(){
		$this->getTemplate()->assign('article', $this->article);
		return parent::render();;
	}

}